package com.syxbyi._3game;

import java.util.LinkedList;
import java.util.List;

public class Player {
    List<Card> myCards = new LinkedList<>();

    public void getCard(Card card) {
        if (myCards.isEmpty()) {
            myCards.add(card);
        } else {
            int i = 0;
            for (; i < myCards.size(); i++) {
                if (Rank.getValue(card.rank) > Rank.getValue(myCards.get(i).rank))
                   break;
            }
            myCards.add(i, card);
        }
    }

    public List<Card> getMyCards() {
        return myCards;
    }
}
